<!DOCTYPE html>
<html lang="zh-CN">
  <head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta name="description" content="">
  <meta name="keywords" content="">
  
    <link rel="icon" href="/avatar.jpg">
  
    
  <title>科学君的不科学博客</title>
  <link rel="stylesheet" href="/style.css">
  <link rel="stylesheet" href="/lib/jquery.fancybox.min.css">
  <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
  <script type="text/javascript" src="https://tajs.qq.com/stats?sId=65546304" charset="UTF-8"></script>
  <script>
  (function(){
      var bp = document.createElement('script');
      var curProtocol = window.location.protocol.split(':')[0];
      if (curProtocol === 'https') {
          bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
      }
      else {
          bp.src = 'http://push.zhanzhang.baidu.com/push.js';
      }
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(bp, s);
  })();
  </script>
</head>

<body>
  <header>
  <div class="header-container">
    <a class='logo' href="/">
      <span>科学君的不科学博客</span>
    </a>
    <ul class="right-header">
      
        <li class="nav-item">
          
            <a href="/" class="item-link active">首页</a>
          
        </li>
      
        <li class="nav-item">
          
            <a href="/about" class="item-link">关于</a>
          
        </li>
      
        <li class="nav-item">
          
            <a href="/archives" class="item-link">归档</a>
          
        </li>
      
        <li class="nav-item">
          
            <a href="/tags" class="item-link">标签</a>
          
        </li>
      
        <li class="nav-item">
          
            <a href="/atom.xml" class="item-link">FEED 订阅</a>
          
        </li>
      
    </ul>
  </div>
</header>

  <main id='index'>
  <div class="posts-list">
    
      <section>
        <a href="/2016/05/04/kingisdead.org/">
          <h3 class='post-head'>
            皇帝死了
          </h3>
        </a>
        
        <div class="post-content">
          
            
              
                <p>在老汉六十多岁的时候，皇帝死了。</p>
              
          
        </div>
        <div class='post-meta'>
          <i class="fa fa-calendar" aria-hidden="true"></i> <time>2016年05月04日</time>
          
            | <i class="fa fa-folder-open-o" aria-hidden="true"></i> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/blog/">blog</a>
  </div>



          
          
            <span class="seperator">|</span>
             
                <i class="fa fa-tag" aria-hidden="true"></i>
              
             
  <a href="/tags/#原创小说" class='tag'>原创小说</a>


          
        </div>
      </section>
    
      <section>
        <a href="/2016/05/04/UVA-548.org/">
          <h3 class='post-head'>
            UVA-548 Tree
          </h3>
        </a>
        
        <div class="post-content">
          
            
              
                <h1 id="题目："><a href="#题目：" class="headerlink" title="题目："></a>题目：</h1><p class="verse"><br><br><br>You are to determine the value of the leaf node in a given binary tree that is the terminal node of a<br><br>path of least value from the root of the binary tree to any leaf. The value of a path is the sum of values<br><br>of nodes along that path.<br><br><br><br>Input<br><br><br><br>The input file will contain a description of the binary tree given as the inorder and postorder traversal<br><br>sequences of that tree. Your program will read two line (until end of file) from the input file. The first<br><br>line will contain the sequence of values associated with an inorder traversal of the tree and the second<br><br>line will contain the sequence of values associated with a postorder traversal of the tree.  All values<br><br>will be different, greater than zero and less than 10000. You may assume that no binary tree will have<br><br>more than 10000 nodes or less than 1 node.<br><br><br><br>Output<br><br><br><br>For each tree description you should output the value of the leaf node of a path of least value. In the<br><br>case of multiple paths of least value you should pick the one with the least value on the terminal node.<br><br><br><br>Sample Input<br><br><br><br>3  2  1  4  5  7  6<br><br><br><br>3  1  2  5  6  7  4<br><br><br><br>7  8  11  3  5  16  12  18<br><br><br><br>8  3  11  7  16  18  12  5<br><br><br><br>255<br><br><br><br>255<br><br><br><br>Sample Output<br><br><br><br>1<br><br><br><br>3<br><br><br><br>255<br><br><br><br></p>
              
          
        </div>
        <div class='post-meta'>
          <i class="fa fa-calendar" aria-hidden="true"></i> <time>2016年05月04日</time>
          
            | <i class="fa fa-folder-open-o" aria-hidden="true"></i> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/acm/">acm</a>
  </div>



          
          
            <span class="seperator">|</span>
             
                <i class="fa fa-tag" aria-hidden="true"></i>
              
             
  <a href="/tags/#acm" class='tag'>acm</a>


          
        </div>
      </section>
    
      <section>
        <a href="/2016/04/28/hdu-5670.org/">
          <h3 class='post-head'>
            HDU-5670 Machine
          </h3>
        </a>
        
        <div class="post-content">
          
            
              
                <h1 id="题目："><a href="#题目：" class="headerlink" title="题目："></a>题目：</h1><p>Machine Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 543 Accepted Submission(s): 313</p>
              
          
        </div>
        <div class='post-meta'>
          <i class="fa fa-calendar" aria-hidden="true"></i> <time>2016年04月28日</time>
          
            | <i class="fa fa-folder-open-o" aria-hidden="true"></i> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/acm/">acm</a>
  </div>



          
          
            <span class="seperator">|</span>
             
                <i class="fa fa-tags" aria-hidden="true"></i>
              
             
  <a href="/tags/#acm" class='tag'>acm</a>

  <a href="/tags/#水题" class='tag'>水题</a>


          
        </div>
      </section>
    
      <section>
        <a href="/2016/04/28/uva-442.org/">
          <h3 class='post-head'>
            UVA-442 Matrix Chain Multiplication
          </h3>
        </a>
        
        <div class="post-content">
          
            
              
                <h1 id="题目："><a href="#题目：" class="headerlink" title="题目："></a>题目：</h1><p>Matrix Chain Multiplication</p>
              
          
        </div>
        <div class='post-meta'>
          <i class="fa fa-calendar" aria-hidden="true"></i> <time>2016年04月28日</time>
          
            | <i class="fa fa-folder-open-o" aria-hidden="true"></i> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/acm/">acm</a>
  </div>



          
          
            <span class="seperator">|</span>
             
                <i class="fa fa-tags" aria-hidden="true"></i>
              
             
  <a href="/tags/#acm" class='tag'>acm</a>

  <a href="/tags/#栈" class='tag'>栈</a>

  <a href="/tags/#矩阵运算" class='tag'>矩阵运算</a>


          
        </div>
      </section>
    
      <section>
        <a href="/2016/04/21/hdu-1221.org/">
          <h3 class='post-head'>
            HDU-1221 Rectangle and Circle
          </h3>
        </a>
        
        <div class="post-content">
          
            
              
                <h1 id="题目："><a href="#题目：" class="headerlink" title="题目："></a>题目：</h1><p>Rectangle and Circle Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2856 Accepted Submission(s): 705</p>
              
          
        </div>
        <div class='post-meta'>
          <i class="fa fa-calendar" aria-hidden="true"></i> <time>2016年04月21日</time>
          
            | <i class="fa fa-folder-open-o" aria-hidden="true"></i> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/acm/">acm</a>
  </div>



          
          
            <span class="seperator">|</span>
             
                <i class="fa fa-tags" aria-hidden="true"></i>
              
             
  <a href="/tags/#acm" class='tag'>acm</a>

  <a href="/tags/#数学题" class='tag'>数学题</a>


          
        </div>
      </section>
    
      <section>
        <a href="/2016/04/17/hdu-1527.org/">
          <h3 class='post-head'>
            HDU-1527 取石子游戏
          </h3>
        </a>
        
        <div class="post-content">
          
            
              
                <ul>
              
          
        </div>
        <div class='post-meta'>
          <i class="fa fa-calendar" aria-hidden="true"></i> <time>2016年04月17日</time>
          
            | <i class="fa fa-folder-open-o" aria-hidden="true"></i> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/acm/">acm</a>
  </div>



          
          
            <span class="seperator">|</span>
             
                <i class="fa fa-tag" aria-hidden="true"></i>
              
             
  <a href="/tags/#acm" class='tag'>acm</a>


          
        </div>
      </section>
    
      <section>
        <a href="/2016/04/14/hdu-1166.org/">
          <h3 class='post-head'>
            HDU-1166 敌兵布阵
          </h3>
        </a>
        
        <div class="post-content">
          
            
              
                <h1 id="题目："><a href="#题目：" class="headerlink" title="题目："></a>题目：</h1><p class="verse"><br>敌兵布阵<br><br>Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)<br><br>Total Submission(s): 69427    Accepted Submission(s): 29197<br><br><br><br><br><br>Problem Description<br><br>C 国的死对头 A 国这段时间正在进行军事演习，所以 C 国间谍头子 Derek 和他手下 Tidy 又开始忙乎了。A 国在海岸线沿直线布置了 N 个工兵营地,Derek 和 Tidy 的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段，所以每个工兵营地的人数 C 国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动，可能增加或减少若干人手,但这些都逃不过 C 国的监视。<br><br>中央情报局要研究敌人究竟演习什么战术,所以 Tidy 要随时向 Derek 汇报某一段连续的工兵营地一共有多少人,例如 Derek 问:“Tidy,马上汇报第 3 个营地到第 10 个营地共有多少人!”Tidy 就要马上开始计算这一段的总人数并汇报。但敌兵营地的人数经常变动，而 Derek 每次询问的段都不一样，所以 Tidy 不得不每次都一个一个营地的去数，很快就精疲力尽了，Derek 对 Tidy 的计算速度越来越不满:”你个死肥仔，算得这么慢，我炒你鱿鱼!”Tidy 想：“你自己来算算看，这可真是一项累人的工作!我恨不得你炒我鱿鱼呢!”无奈之下，Tidy 只好打电话向计算机专家 Windbreaker 求救,Windbreaker 说：“死肥仔，叫你平时做多点 acm 题和看多点算法书，现在尝到苦果了吧!”Tidy 说：”我知错了。。。”但 Windbreaker 已经挂掉电话了。Tidy 很苦恼，这么算他真的会崩溃的，聪明的读者，你能写个程序帮他完成这项工作吗？不过如果你的程序效率不够高的话，Tidy 还是会受到 Derek 的责骂的.<br><br><br><br><br><br>Input<br><br>第一行一个整数 T，表示有 T 组数据。<br><br>每组数据第一行一个正整数 N（N&lt;=50000）,表示敌人有 N 个工兵营地，接下来有 N 个正整数,第 i 个正整数 ai 代表第 i 个工兵营地里开始时有 ai 个人（1&lt;=ai&lt;=50）。<br><br>接下来每行有一条命令，命令有 4 种形式：<br><br>(1) Add i j,i 和 j 为正整数,表示第 i 个营地增加 j 个人（j 不超过 30）<br><br>(2)Sub i j ,i 和 j 为正整数,表示第 i 个营地减少 j 个人（j 不超过 30）;<br><br>(3)Query i j ,i 和 j 为正整数,i&lt;=j，表示询问第 i 到第 j 个营地的总人数;<br><br>(4)End 表示结束，这条命令在每组数据最后出现;<br><br>每组数据最多有 40000 条命令<br><br><br><br><br><br>Output<br><br>对第 i 组数据,首先输出“Case i:”和回车,<br><br>对于每个 Query 询问，输出一个整数并回车,表示询问的段中的总人数,这个数保持在 int 以内。<br><br><br><br><br><br>Sample Input<br><br><br><br>1<br><br>10<br><br>1 2 3 4 5 6 7 8 9 10<br><br>Query 1 3<br><br>Add 3 6<br><br>Query 2 7<br><br>Sub 10 2<br><br>Add 6 3<br><br>Query 3 10<br><br>End<br><br><br><br><br><br><br><br>Sample Output<br><br><br><br>Case 1:<br><br>6<br><br>33<br><br>59<br><br><br><br></p>
              
          
        </div>
        <div class='post-meta'>
          <i class="fa fa-calendar" aria-hidden="true"></i> <time>2016年04月14日</time>
          
            | <i class="fa fa-folder-open-o" aria-hidden="true"></i> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/acm/">acm</a>
  </div>



          
          
            <span class="seperator">|</span>
             
                <i class="fa fa-tags" aria-hidden="true"></i>
              
             
  <a href="/tags/#acm" class='tag'>acm</a>

  <a href="/tags/#线段树" class='tag'>线段树</a>


          
        </div>
      </section>
    
      <section>
        <a href="/2016/03/28/hello-world.org/">
          <h3 class='post-head'>
            Hello world
          </h3>
        </a>
        
        <div class="post-content">
          
            
              
                <p>我的第一篇博客，使用 emacs org-page 生成，发布于 github 上。其实这篇博客我已经发了好几遍了，但是一直都没有搞好。如果你也想用 org-page 来写文章的话，请一定要把 quick-guide 读完！还有，op/new-post 的时候一定要把 git 切换到 source 分支！要不然 org 文件的保存位置会不对的。我就是这样被坑了。好了，刚才又被坑了，org-page 不会自动保存，在 publish 之前一定要先手动保存。</p>
              
          
        </div>
        <div class='post-meta'>
          <i class="fa fa-calendar" aria-hidden="true"></i> <time>2016年03月28日</time>
          
            | <i class="fa fa-folder-open-o" aria-hidden="true"></i> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/blog/">blog</a>
  </div>



          
          
            <span class="seperator">|</span>
             
                <i class="fa fa-tags" aria-hidden="true"></i>
              
             
  <a href="/tags/#emacs" class='tag'>emacs</a>

  <a href="/tags/#github" class='tag'>github</a>


          
        </div>
      </section>
    
  </div>
  <aside>
    
    <div class="search">
      <div class="content">
        <form action="//www.google.com/search" target="_blank" class="search-form">
          <input type="text" name="q" maxlength="20" placeholder="搜索">
          <input type="hidden" name='sitesearch' value="https://liu233w.github.io">
        </form>
      </div>
    </div>
    
    
      <div class="avatar">
        <img src="/avatar.jpg" alt="avatar">
          
            <div class="content">
                <span>@不科学的科学君</span>
            </div>
          
      </div>
    
    
      <div class="categories">
        <h1>
          文章分类
        </h1>
        <div class="content">
          <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/acm/">acm</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/blog/">blog</a></li></ul>
        </div>
      </div>
    
    
      <div class="links">
        <h1>
          友情链接
        </h1>
        <div class="content">
          
            <a href="https://liu233w.github.io" target="_blank">博客主链接（这个最新，其他的都是镜像站）</a>
          
            <a href="https://github.com/liu233w/" target="_blank">我的Github</a>
          
        </div>
      </div>
    
  </aside>
</main>

  <div class="paging">
  <div class="paging-container">
    
    <div class='page-prev'>
      <a href="/page/5/">上一页</a>
    </div>
    
    
  </div>
</div>



  <footer>
  <div class="copyright">
    <div>
      &copy; 2019 | Powered by <a href="https://hexo.io" target="_blank">Hexo</a>&nbsp
    </div>
    <div>
      Theme by <a href="https://github.com/lewis-geek/hexo-theme-Aath" target="_blank">Aath</a>
    </div>
  </div>
</footer>


<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

</body>
</html>
